# This is test3.py
class Node:
    def __init__(self, data):
        self.data = data
        self.next = None

    def __str__(self):
        return str(self.data)

class LinkedList:
    def __init__(self):
        self.head = None

    def __str__(self):
        ret = []
        node = self.head
        while node:
            ret.append(str(node))
            node = node.next
        return'->'.join(ret)

    def __iter__(self):
        node = self.head
        while node:
            yield node.data
            node = node.next
